<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function All() { //函数的第一个最好大写
            let elementsByName = document.getElementsByName("good");
            for (let i = 0; i < elementsByName.length; i++) {
                elementsByName[i].checked = true;
            }
        }
        function NoALL() {
            let elementsByName = document.getElementsByName("good");
            for (let i = 0; i < elementsByName.length; i++) {
                elementsByName[i].checked = false;
            }
        }
        function someALL() {
            let elementsByName = document.getElementsByName("good");
            for (let i = 0; i < elementsByName.length; i++) {
                if (elementsByName[i].checked ==true){
                    elementsByName[i].checked = false;
                }else {
                    elementsByName[i].checked = true;
                }
            }
        }
    </script>
</head>
<body>
    <input type="checkbox" value="one" name="good" >one
    <input type="checkbox" value="two" name="good">two
    <input type="checkbox" value="three" name="good">three<br>
    <button onclick="All()">全选</button>
    <button onclick="NoALL()">全不选</button>
    <button onclick="someALL()">反选</button>
</body>
</html>